package scientistengineer.blogspot.affrpor;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.AdapterView.OnItemClickListener;

public class Beginner extends Activity {
		
	private RowIconText [] row_data;
	private IconTextAdapter adapter;

	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.begginer_menu);
		
		//ArrayAdapter<String> codeLearnArrayAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, BEGINNER_CHOICES);
		
		row_data = new RowIconText[]
				{
				new RowIconText(R.drawable.greetings2, "Greetings"),
				new RowIconText(R.drawable.introduction2, "Introduction/Presentation"),
				new RowIconText(R.drawable.social, "Social Etiquette"),
				new RowIconText(R.drawable.meeting_people, "Meeting People"),
				new RowIconText(R.drawable.talking_languages, "Talking About Languages"),
				new RowIconText(R.drawable.family, "Family"),
				new RowIconText(R.drawable.describing_people, "Describing People"),
				new RowIconText(R.drawable.colors, "Colors"),
				new RowIconText(R.drawable.numbers, "Numbers"),
				new RowIconText(R.drawable.days_week, "Days of the week"),
				new RowIconText(R.drawable.parts_body, "Parts of the Body"),
				new RowIconText(R.drawable.animals, "Animals"),
				new RowIconText(R.drawable.food, "Food"),
				new RowIconText(R.drawable.fruits_and_vegetables, "Fruits and Vegetables")				
				};
		adapter = new IconTextAdapter(this, R.layout.listview_icon_text , row_data);
		  
		ListView codeLearnLessons = (ListView)findViewById(R.id.beginnerMenuListView);

		codeLearnLessons.setAdapter(adapter);
		
		codeLearnLessons.setOnItemClickListener(new OnItemClickListener()
		{

			@Override
			public void onItemClick(AdapterView<?> parent, View view,
					int position, long id) {
				// TODO Auto-generated method stub
				switch(position)
				{
				case 0:
					//Greetings
					Intent launchGreetings = new Intent(Beginner.this, Greetings.class);
					startActivity(launchGreetings);	
					
					break;
				case 1:
					//Introduction
					Intent launchIntroduction = new Intent(Beginner.this, Introduction.class);
					startActivity(launchIntroduction);	
					
					break;
				case 2:
					//Social
					Intent launchSocial = new Intent(Beginner.this, Social.class);
					startActivity(launchSocial);	
					break;
				
				case 3:
					Intent launchMeetingPeople = new Intent(Beginner.this, MeetingPeople.class);
					startActivity(launchMeetingPeople);
					break;
				case 4:
					Intent launchTalkingLanguages = new Intent(Beginner.this, TalkingLanguages.class);
					startActivity(launchTalkingLanguages);
					break;
				case 5:
					Intent launchFamily = new Intent(Beginner.this, Family.class);
					startActivity(launchFamily);
					break;
				case 6:
					Intent launchDescribingPeople = new Intent(Beginner.this, DescribingPeople.class);
					startActivity(launchDescribingPeople);
					break;
				case 7:
					Intent launchColors = new Intent(Beginner.this, ColorsWords.class);
					startActivity(launchColors);
					break;
				case 8:
					Intent launchNumbers = new Intent(Beginner.this, Numbers.class);
					startActivity(launchNumbers);
					break;
				case 9:
					Intent launchWeekDays = new Intent(Beginner.this, WeekDays.class);
					startActivity(launchWeekDays);
					break;
				case 10:
					Intent launchPartsBody = new Intent(Beginner.this, PartsBody.class);
					startActivity(launchPartsBody);
					break;
				case 11:
					Intent launchAnimals = new Intent(Beginner.this, Animals.class);
					startActivity(launchAnimals);
					break;
				case 12:
					Intent launchFood = new Intent(Beginner.this, Food.class);
					startActivity(launchFood);
					break;
				case 13:
					Intent launchFruitsVeggie = new Intent(Beginner.this, FruitVeggie.class);
					startActivity(launchFruitsVeggie);
					break;
				}
			}
			
		});

		
		
		
	}

}
